import request from '@/utils/request'

// 创建监测数据
export function createMonitoringData(data) {
  return request({
    url: '/hardware/monitoring-data/create',
    method: 'post',
    data: data
  })
}

// 更新监测数据
export function updateMonitoringData(data) {
  return request({
    url: '/hardware/monitoring-data/update',
    method: 'put',
    data: data
  })
}

// 删除监测数据
export function deleteMonitoringData(id) {
  return request({
    url: '/hardware/monitoring-data/delete?id=' + id,
    method: 'delete'
  })
}

// 获得监测数据
export function getMonitoringData(id) {
  return request({
    url: '/hardware/monitoring-data/get?id=' + id,
    method: 'get'
  })
}

// 获得监测数据分页
export function getMonitoringDataPage(query) {
  return request({
    url: '/hardware/monitoring-data/page',
    method: 'get',
    params: query
  })
}
// 拆线统计
export function getMonitoringDataStatistical(query) {
  return request({
    url: '/hardware/monitoring-data/statistical',
    method: 'get',
    params: query
  })
}


// 导出监测数据 Excel
export function exportMonitoringDataExcel(query) {
  return request({
    url: '/hardware/monitoring-data/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
